package abstractEntities;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import entities.Departament;
import entities.User;
import entitiesIds.LeveldepartamentId;

/**
 * AbstractLeveldepartament entity provides the base persistence definition of
 * the Leveldepartament entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractLeveldepartament implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 2570125996716030180L;
	private LeveldepartamentId id;
	private Departament departament;
	private User user;
	private Integer points;
	private Integer level;

	// Constructors

	/** default constructor */
	public AbstractLeveldepartament() {
	}

	/** full constructor */
	public AbstractLeveldepartament(LeveldepartamentId id,
			Departament departament, User user, Integer points, Integer level) {
		this.id = id;
		this.departament = departament;
		this.user = user;
		this.points = points;
		this.level = level;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idUser", column = @Column(name = "idUser", nullable = false)),
			@AttributeOverride(name = "idDepartament", column = @Column(name = "idDepartament", nullable = false)) })
	public LeveldepartamentId getId() {
		return this.id;
	}

	public void setId(LeveldepartamentId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idDepartament", nullable = false, insertable = false, updatable = false)
	public Departament getDepartament() {
		return this.departament;
	}

	public void setDepartament(Departament departament) {
		this.departament = departament;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser", nullable = false, insertable = false, updatable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "points", nullable = false)
	public Integer getPoints() {
		return this.points;
	}

	public void setPoints(Integer points) {
		this.points = points;
	}

	@Column(name = "level", nullable = false)
	public Integer getLevel() {
		return this.level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

}